<script>
    let arr = [1,2,3,4,5,6]  //21
    
   var a = arr.reduce((a,b,c,d)=>{
      
        return a + b 
    })
    console.log(a);

    var num = 0
    for(var i=0;i<arr.length; i++){
        num+= arr[i]
    }
    console.log(num);
</script>